<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>quaternion.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">quaternion.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Implements quaternions and their conversion functions. In this
 implementation, quaternions are represented as 4 element vectors with the
 first 3 elements holding the imaginary components and the 4th element holding
 the real component.
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_vec_quaternion.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/closure/goog/vec/quaternion.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">vec/quaternion.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.add"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">add<span class="args">(<span class="arg">quat0</span>,&nbsp;<span class="arg">quat1</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Adds the two quaternions.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The first addend.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">quat1</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The second addend.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the result. May be quat0 or quat1.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line161">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.cloneFloat32"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">cloneFloat32<span class="args">(<span class="arg">q</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Creates a clone of the given Float32 quaternion.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">q</span>
        : <div class="fullType">(<span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source quaternion.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line114">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.cloneFloat64"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">cloneFloat64<span class="args">(<span class="arg">q</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Creates a clone of the given Float64 quaternion.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">q</span>
        : <div class="fullType">(<span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source quaternion.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line123">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.concat"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">concat<span class="args">(<span class="arg">quat0</span>,&nbsp;<span class="arg">quat1</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>
      </div>


     <div class="entryOverview">
       Concatenates the two quaternions storing the result into resultQuat.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The first quaternion.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">quat1</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The second quaternion.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the result.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>&nbsp;
            Return q so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line256">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.conjugate"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">conjugate<span class="args">(<span class="arg">quat</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>
      </div>


     <div class="entryOverview">
       Computes the conjugate of the quaternion in quat storing the result into
resultQuat.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source quaternion.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the result.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>&nbsp;
            Return q so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line237">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.createFloat32"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">createFloat32<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type">Float32Array</span></div>
      </div>


     <div class="entryOverview">
       Creates a Float32 quaternion, initialized to zero.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">Float32Array</span></div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line41">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.createFloat32FromArray"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">createFloat32FromArray<span class="args">(<span class="arg">vec</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">Float32Array</span></div>
      </div>


     <div class="entryOverview">
       Creates a new Float32 quaternion initialized with the values from the
supplied array.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">vec</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source 4 element array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">Float32Array</span></div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line67">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.createFloat32FromValues"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">createFloat32FromValues<span class="args">(<span class="arg">v0</span>,&nbsp;<span class="arg">v1</span>,&nbsp;<span class="arg">v2</span>,&nbsp;<span class="arg">v3</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">Float32Array</span></div>
      </div>


     <div class="entryOverview">
       Creates a new Float32 quaternion initialized with the supplied values.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">v0</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 0.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">v1</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 1.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">v2</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 2.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">v3</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 3.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">Float32Array</span></div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line91">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.createFloat64"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">createFloat64<span class="args">()</span>
        </span>
        &#8658; <div class="fullType">(<span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Creates a Float64 quaternion, initialized to zero.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line49">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.createFloat64FromArray"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">createFloat64FromArray<span class="args">(<span class="arg">vec</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">Float64Array</span></div>
      </div>


     <div class="entryOverview">
       Creates a new Float64 quaternion initialized with the values from the
supplied array.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">vec</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source 4 element array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">Float64Array</span></div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line78">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.createFloat64FromValues"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">createFloat64FromValues<span class="args">(<span class="arg">v0</span>,&nbsp;<span class="arg">v1</span>,&nbsp;<span class="arg">v2</span>,&nbsp;<span class="arg">v3</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">Float64Array</span></div>
      </div>


     <div class="entryOverview">
       Creates a new Float64 quaternion initialized with the supplied values.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">v0</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 0.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">v1</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 1.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">v2</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 2.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">v3</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 3.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">Float64Array</span></div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line104">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.createNumber"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">createNumber<span class="args">()</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Creates a Number quaternion, initialized to zero.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            The new quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line57">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.dot"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">dot<span class="args">(<span class="arg">q0</span>,&nbsp;<span class="arg">q1</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Computes the dot (scalar) product of two quaternions.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">q0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The first quaternion.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">q1</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The second quaternion.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The scalar product.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line224">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.fromAngleAxis"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">fromAngleAxis<span class="args">(<span class="arg">angle</span>,&nbsp;<span class="arg">axis</span>,&nbsp;<span class="arg">quat</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Generates a unit quaternion from the given angle-axis rotation pair.
The rotation axis is not required to be a unit vector, but should
have non-zero length.  The angle should be specified in radians.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">angle</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The angle (in radians) to rotate about the axis.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">axis</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">Unit vector specifying the axis of rotation.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">quat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">Unit quaternion to store the result.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            Return q so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line280">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.fromRotationMatrix4"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">fromRotationMatrix4<span class="args">(<span class="arg">matrix</span>,&nbsp;<span class="arg">quat</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>
      </div>


     <div class="entryOverview">
       Generates the quaternion from the given rotation matrix.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">matrix</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source matrix.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">quat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The resulting quaternion.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>&nbsp;
            Return q so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line337">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.magnitude"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">magnitude<span class="args">(<span class="arg">quat0</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the magnitude of the given quaternion.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The magnitude of the quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line202">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.magnitudeSquared"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">magnitudeSquared<span class="args">(<span class="arg">quat0</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the square magnitude of the given quaternion.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The magnitude of the quaternion.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line192">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.negate"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">negate<span class="args">(<span class="arg">quat0</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Negates a quaternion, storing the result into resultQuat.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to negate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the result. May be quat0.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line171">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.nlerp"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">nlerp<span class="args">(<span class="arg">q0</span>,&nbsp;<span class="arg">q1</span>,&nbsp;<span class="arg">t</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Compute the simple linear interpolation of the two quaternions q0 and q1
according to the coefficient t. The resulting quaternion is stored in
resultVec.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">q0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The first quaternion.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">q1</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The second quaternion.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">t</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The interpolation factor.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the results (may be q0 or q1).</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line458">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.normalize"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">normalize<span class="args">(<span class="arg">quat0</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Normalizes the given quaternion storing the result into resultVec.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to normalize.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the result. May be quat0.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line214">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.scale"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">scale<span class="args">(<span class="arg">quat0</span>,&nbsp;<span class="arg">scalar</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Multiplies each component of quat0 with scalar storing the product into
resultVec.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source quaternion.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">scalar</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value to multiply with each component of quat0.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the result. May be quat0.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line183">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.setFromArray"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">setFromArray<span class="args">(<span class="arg">q</span>,&nbsp;<span class="arg">values</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>
      </div>


     <div class="entryOverview">
       Initializes the quaternion with the given array of values.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">q</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the values.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">values</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The array of values.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>&nbsp;
            return q so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line150">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.setFromValues"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">setFromValues<span class="args">(<span class="arg">q</span>,&nbsp;<span class="arg">v0</span>,&nbsp;<span class="arg">v1</span>,&nbsp;<span class="arg">v2</span>,&nbsp;<span class="arg">v3</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>
      </div>


     <div class="entryOverview">
       Initializes the quaternion with the given values.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">q</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the values.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">v0</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 0.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">v1</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 1.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">v2</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 2.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">v3</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The value for element at index 3.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>&nbsp;
            return q so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line138">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.slerp"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">slerp<span class="args">(<span class="arg">q0</span>,&nbsp;<span class="arg">q1</span>,&nbsp;<span class="arg">t</span>,&nbsp;<span class="arg">resultQuat</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Computes the spherical linear interpolated value from the given quaternions
q0 and q1 according to the coefficient t. The resulting quaternion is stored
in resultQuat.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">q0</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The first quaternion.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">q1</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The second quaternion.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">t</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The interpolating coefficient.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">resultQuat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The quaternion to receive the result.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            Return q so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line405">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.toAngleAxis"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">toAngleAxis<span class="args">(<span class="arg">quat</span>,&nbsp;<span class="arg">axis</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Generates an angle-axis rotation pair from a unit quaternion.
The quaternion is assumed to be of unit length.  The calculated
values are returned via the passed 'axis' object and the 'angle'
number returned by the function itself. The returned rotation axis
is a non-zero length unit vector, and the returned angle is in
radians in the range of [-PI, +PI].
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">Unit quaternion to convert.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">axis</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">Vector to store the returned rotation axis.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            angle Angle (in radians) to rotate about 'axis'. The range of the returned angle is [-PI, +PI].
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line309">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.vec.Quaternion.toRotationMatrix4"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.vec.Quaternion.</span><span class="entryName">toRotationMatrix4<span class="args">(<span class="arg">quat</span>,&nbsp;<span class="arg">matrix</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>
      </div>


     <div class="entryOverview">
       Generates the rotation matrix from the given quaternion.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">quat</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The source quaternion.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">matrix</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">The resulting matrix.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">Float32Array</span><span>&nbsp;|&nbsp;</span><span class="type">Float64Array</span>)</div>&nbsp;
            Return resulting matrix so that operations can be chained together.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_vec_quaternion.js.source.html#line359">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory vec</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="vec/quaternion.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
